from PIL import Image

#im = Image.open(r'C:\Users\Henry\Desktop\AA062210.png')
im = Image.open(r"F:\工作\红外三维\处理后数据\tif\AA062210.tif")
max_temp = 41.3
min_temp = 23.9

px = im.load()
w, h = im.size
print(w, h)
image_px_list = set()
for i in range(w):
    for j in range(h):
        image_px_list.add(px[i, j])

diff_px_count = len(image_px_list)
print(diff_px_count)
print((max_temp - min_temp) / diff_px_count)